<template>
  <div class="showcase-home">
    <div class="header-section">
      <h2 class="section-title">技术演示</h2>
      <p class="section-desc">探索现代Web技术的强大功能与创新特性</p>
      <div class="header-decoration">
        <div class="decoration-line"></div>
        <div class="decoration-dot"></div>
        <div class="decoration-line"></div>
      </div>
    </div>

    <div class="modules-grid">
      <router-link 
        v-for="module in modules" 
        :key="module.path"
        :to="`/showcase/${module.path}`"
        class="module-card"
      >
        <div class="card-content">
          <div class="module-icon" :class="module.path">{{ module.icon }}</div>
          <div class="card-body">
            <h3>{{ module.name }}</h3>
            <p>{{ module.description }}</p>
          </div>
          <div class="features">
            <span v-for="feature in module.features" :key="feature">{{ feature }}</span>
          </div>
        </div>
        <div class="card-overlay">
          <span class="explore-text">点击探索</span>
        </div>
      </router-link>
    </div>

    <div class="background-decoration">
      <div class="circle circle-1"></div>
      <div class="circle circle-2"></div>
      <div class="circle circle-3"></div>
    </div>
  </div>
</template>

<script setup>
const modules = [
  {
    name: 'HTML5',
    path: 'html',
    icon: '🌐',
    description: '探索HTML5最新特性和API，体验现代Web的强大功能',
    features: ['Canvas绘图', '拖放操作', '本地存储', '音频控制']
  },
  {
    name: 'CSS3',
    path: 'css',
    icon: '🎨',
    description: '体验现代CSS的强大效果，创造令人惊叹的视觉体验',
    features: ['渐变效果', '变换动画', '响应式布局', '滤镜特效']
  },
  {
    name: 'JavaScript',
    path: 'javascript',
    icon: '⚡',
    description: '展示JavaScript的高级特性，掌握现代编程技巧',
    features: ['异步操作', '数组方法', '对象操作', 'ES6+特性']
  },
  {
    name: 'TypeScript',
    path: 'typescript',
    icon: '📘',
    description: '探索TypeScript的类型系统和高级特性，提升代码质量',
    features: ['类型系统', '接口定义', '泛型编程', '装饰器']
  },
  {
    name: 'Three.js',
    path: 'threejs',
    icon: '🎮',
    description: '体验3D图形和动画效果，探索Web 3D的无限可能',
    features: ['3D几何体', '材质效果', '光照系统', '动画控制']
  },
  {
    name: 'Vue 3',
    path: 'vue3',
    icon: '⚛️',
    description: '展示 Vue 3 的新特性和最佳实践',
    features: ['Composition API', '响应式系统', 'Teleport', 'Fragments']
  },
  {
    name: 'Echarts',
    path: 'echarts',
    icon: '📊',
    description: '展示Echarts数据可视化图表和交互功能',
    features: ['基础图表', '高级图表', '交互功能', '主题定制']
  }
]
</script>

<style scoped>
.showcase-home {
  padding: 2rem;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.header-section {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
}

.section-desc {
  font-size: 1.2rem;
  color: var(--text-color);
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 1rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
}

.module-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  height: 100%;
}

.card-content {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
  background: transparent;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
}

.explore-text {
  color: #00ff88;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 1rem 2rem;
  border: 2px solid #00ff88;
  border-radius: 30px;
  background: rgba(0, 255, 136, 0.1);
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.module-card:hover .card-overlay {
  opacity: 1;
}

.module-card:hover .explore-text {
  transform: translateY(0);
}

.module-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-5px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.1);
}

.module-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.module-card:hover .module-icon {
  transform: scale(1.1);
}

.card-body {
  flex: 1;
  margin-bottom: 2rem;
}

.card-body h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
}

.card-body p {
  font-size: 1.1rem;
  color: #b8e0d2;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  position: relative;
  z-index: 1;
  background: transparent;
}

.features span {
  background: rgba(0, 255, 136, 0.05);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.95rem;
  border: 1px solid rgba(0, 255, 136, 0.2);
  transition: all 0.3s ease;
  color: #00ff88;
  backdrop-filter: blur(2px);
}

.module-card:hover .features span {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
}

.background-decoration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: rgba(0, 255, 136, 0.1);
  top: -100px;
  right: -100px;
}

.circle-2 {
  width: 300px;
  height: 300px;
  background: rgba(0, 161, 255, 0.1);
  bottom: -50px;
  left: -50px;
}

.circle-3 {
  width: 200px;
  height: 200px;
  background: rgba(255, 0, 136, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
  .showcase-home {
    padding: 1.5rem;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .section-desc {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .modules-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card-content {
    padding: 2rem 1.5rem;
  }

  .module-icon {
    font-size: 3rem;
  }

  .card-body h3 {
    font-size: 1.8rem;
  }

  .card-body p {
    font-size: 1rem;
  }
}

@media (min-width: 1400px) {
  .showcase-home {
    padding: 3rem;
  }

  .section-title {
    font-size: 4rem;
  }

  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
</style> 